package com.turing.post.tuxedo.util;

import java.io.Serializable;
import java.math.BigInteger;

import org.jdom2.Element;

import com.turing.post.util.PCPSApplicationException;

/**
 * 对帐交易输入
 * 
 * @author yxb
 * 
 */
@SuppressWarnings("serial")
public class ICheckAcc extends TransRequest implements Serializable {
	/**
	 * 借方笔数
	 */
	public BigInteger debitCount = BigInteger.ZERO;

	/**
	 * 借方金额
	 */
	public BigInteger debitAmount = BigInteger.ZERO;

	/**
	 * 贷方笔数
	 */
	public BigInteger creditCount = BigInteger.ZERO;

	/**
	 * 贷方金额
	 */
	public BigInteger creditAmount = BigInteger.ZERO;

	/**
	 * 产生计算MAC的域
	 */
	@Override
	protected void generateMacField() {
	}

	/**
	 * 解析交易请求私有报文体
	 * 
	 * @param reqBody
	 * @throws Exception
	 */
	@Override
	protected void parseReqBodyXml(Element reqBody) throws PCPSApplicationException {
		// 借方笔数
		debitCount = TransXmlHelper.getInteger(reqBody,
				TransXmlHelper.XML_NODE_DebitCount);

		// 借方金额
		debitAmount = TransXmlHelper.getInteger(reqBody,
				TransXmlHelper.XML_NODE_DebitAmount);

		// 贷方笔数
		creditCount = TransXmlHelper.getInteger(reqBody,
				TransXmlHelper.XML_NODE_CreditCount);

		// 贷方金额
		creditAmount = TransXmlHelper.getInteger(reqBody,
				TransXmlHelper.XML_NODE_CreditAmount);
	}
}
